package com.example.interview.SE;

import java.util.Objects;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2024-07-03
 * Time:15:08
 * Text：
 */
public class Student {
    int age;
    String sex;
    String name;

    public Student(int age,String sex, String name) {
        this.age = age;
        this.sex = sex;
        this.name = name;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + this.age;
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null || getClass() != obj.getClass())
            return false;
        Student other = (Student) obj;
        return age == other.age &&
                Objects.equals(sex, other.sex) &&
                Objects.equals(name, other.name);
    }

}
